package com.sx.gongzhong.pest;

import android.content.Context;

import com.sx.gongzhong.model.BannerBean;
import com.sx.gongzhong.model.ReplyUserBean;
import com.sx.gongzhong.net.ApiManager;
import com.sx.gongzhong.net.BaseCallBack;
import com.sx.gongzhong.view.BannerView;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**获取首页banner
 * Created by admin on 2018/1/10.
 */

public class BannerPest {
    private BannerView bannerView;

    public BannerPest(BannerView bannerView) {
        this.bannerView = bannerView;
    }

    public void getBanner(Context context) {
        Map<String,Object> map = new HashMap<>();
        new ApiManager().getBanner(map, new BaseCallBack<ReplyUserBean.BaseResult<List<BannerBean>>>() {
            @Override
            public void onSuccess(ReplyUserBean.BaseResult<List<BannerBean>> response) {
                bannerView.getBannerSuccess(response.data);
            }
            @Override
            public void onFailures(String message) {
                bannerView.showError(message);
            }
        });
    }
}
